﻿using System.Diagnostics;
using System.Windows;

namespace VsPackageCommon
{

    public partial class ExceptionWindow
    {

        public ExceptionWindow(ExceptionWindowModel model)
        {
            Model = model;
            InitializeComponent();
            Title = string.Format("An exception occurred in the {0} VSIX", model.ProductName);

            DataContext = Model;
        }

        public ExceptionWindowModel Model { get; private set; }


        void Copy(object sender, RoutedEventArgs e)
        {
            Clipboard.SetText(Model.ExceptionText);
        }


        void Close(object sender, RoutedEventArgs e)
        {
            Close();
        }

        void LaunchIssues(object sender, RoutedEventArgs e)
        {
            Process.Start(Model.IssuesUrl);
        }
    }
}
